<template>
  <view class="news-wrapper">
    <!-- <view class="news-header">
      <text class="news-title">最新资讯</text>
      <view class="news-more"><view>查看更多</view> <u-icon name="arrow-right" size="16rpx" color="#999999" /></view>
    </view> -->
    <view class="news-list">
      <view class="news-item" v-for="(item,index) in newsList" :key="index" @click="handleNews(item)">
        <u-image width="180rpx" height="140rpx" radius="10rpx"  
        :src="item.picUrl" mode="aspectFill" />
        <view class="news-info">
          <view class="news-item-title u-line-2">{{item.noticeTitle}}</view>
          <view class="news-item-desc">{{item.noticeDate}}</view>
        </view>
      </view>
     
    </view>
  </view>
</template>

<script>
export default {
  name: 'News',
  props:{
    newsList:{
      type:Array,
      default:()=>[]
    }
  },
  methods:{
    handleNews(item){
       uni.navigateTo({
        url: `/pages/notice/index?id=${item.id}`
      })
    }
  }
}
</script>

<style scoped>
.news-wrapper {

  border-radius: 12rpx;
  padding: 24rpx 0 0 0;
  margin-top: 24rpx;
}
.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24rpx 18rpx 24rpx;
}
.news-title {
  font-size: 36rpx;
  font-weight: 600;
  color: #333333;
}
.news-more {
  font-size: 24rpx;
  color: #bfc3c8;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-list {
  
}
.news-item {
  display: flex;
  /* align-items: flex-start; */
 
  border-radius: 10rpx;
  margin-bottom: 20rpx;
  overflow: hidden;
  /* padding: ; */
}
.news-img {
  width: 120rpx;
  height: 90rpx;
  border-radius: 8rpx;
  margin-right: 16rpx;
  flex-shrink: 0;
}
.news-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 24rpx;
  /* padding-bottom: 16rpx; */
  border-bottom: 1rpx solid rgba(160, 160, 186, 0.20);
}
.news-item-title {
 font-weight: 400;
  font-size: 30rpx;
  color: #0C243E;
  margin-bottom: 12rpx;
}
.news-item-desc {
 font-weight: 400;
  font-size: 24rpx;
  color: #B3B9CA;
  margin-top: 22rpx;
}
.u-line-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
</style>
